<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<%@ include file="/commons/kindeditor.jsp" %>
<script type="text/javascript">
    $(function() {
    	//初始化类目选择和图片上传器
		TAOTAO.init({fun:function(node){}});
        $('#demo1AddForm').form({
            url : '${path}/admin/demo1/add',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    //之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div style="padding:10px 10px 10px 10px">
        <form id="demo1AddForm" method="post" enctype="multipart/form-data">
            <table class="grid">
				<tr>
                    <td>name:</td>
					<td>
						<input id="name" name="name" type="text" class="easyui-textbox" data-options="prompt:'请输入name',required:true" />
					</td>
				</tr>
				<tr>
                    <td>type:</td>
					<td>
						<input id="type" name="type" type="text" class="easyui-textbox" data-options="prompt:'请输入type',required:true" />
					</td>
				</tr>
				<tr>
                    <td>状态 1正常 0停用:</td>
					<td>
						<select id="status" name="status" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
							${ dic:getBusDictListToOption('DATA_STATUS')}
						</select>
					</td>
				</tr>
				<tr>
                    <td>内容</td>
					<td>
						<textarea id="text" name="text" style="width:400px;height:600px;visibility:hidden;"></textarea>
						<script type="text/javascript">
							var demo1AddKindeditor;
							//页面初始化完毕后执行此方法
							$(function(){
								//创建富文本编辑器
							    demo1AddKindeditor = TAOTAO.createEditor("#demo1AddForm [name=text]");
							});
						</script>
					</td>
				</tr>
				<tr>
                    <td>编辑人:</td>
					<td>
						<input id="createdEditor" name="createdEditor" type="text" class="easyui-textbox" data-options="prompt:'请输入编辑人',required:true" />
					</td>
				</tr>
				<tr>
                    <td>更新人:</td>
					<td>
						<input id="updatedEditor" name="updatedEditor" type="text" class="easyui-textbox" data-options="prompt:'请输入更新人',required:true" />
					</td>
				</tr>
            </table>
        </form>
    </div>